<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.Config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/View/Pages/home.ctp)...
 */
	Router::connect('/', array('controller' => 'index', 'action' => 'index'));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
    Router::connect(  
        '/robots.txt',  
        array(  
            'controller' => 'seo',  
            'action' => 'robots'  
        )  
    );
    Router::connect(  
        '/sitemap.xml',  
        array(  
            'controller' => 'seo',  
            'action' => 'sitemap'  
        )  
    );
    /** 
        subject
    toan hoc rewrite url **/
    Router::connect('/pho-thong-co-so/toan-hoc/*', array('controller' => 'subjects', 'action' => 'view', 1));
    /** vat ly rewrite url **/
    Router::connect('/pho-thong-co-so/vat-ly/*', array('controller' => 'subjects', 'action' => 'view', 2));
    /** hoa hoc rewrite url **/
    Router::connect('/pho-thong-co-so/hoa-hoc/*', array('controller' => 'subjects', 'action' => 'view', 3));
    /** sinh hoc rewrite url **/
    Router::connect('/pho-thong-co-so/sinh-hoc/*', array('controller' => 'subjects', 'action' => 'view', 4));
    /** ngu van rewrite url **/
    Router::connect('/pho-thong-co-so/ngu-van/*', array('controller' => 'subjects', 'action' => 'view', 5));
    /** lich su rewrite url **/
    Router::connect('/pho-thong-co-so/lich-su/*', array('controller' => 'subjects', 'action' => 'view', 6));
    /** dia ly rewrite url **/
    Router::connect('/pho-thong-co-so/dia-ly/*', array('controller' => 'subjects', 'action' => 'view', 7));
    /** tieng anh rewrite url **/
    Router::connect('/pho-thong-co-so/tieng-anh/*', array('controller' => 'subjects', 'action' => 'view', 8));
    /** tin hoc rewrite url **/
    Router::connect('/pho-thong-co-so/tin-hoc/*', array('controller' => 'subjects', 'action' => 'view', 9));
    /** cong nghe rewrite url **/
    Router::connect('/pho-thong-co-so/cong-nghe/*', array('controller' => 'subjects', 'action' => 'view', 10));
    /** khac rewrite url **/
    Router::connect('/pho-thong-co-so/khac/*', array('controller' => 'subjects', 'action' => 'view', 11));
    Router::connect('/pho-thong-co-so', array('controller' => 'subjects', 'action' => 'index'));
    
    /** test **/
    Router::connect('/pho-thong-co-so/xem-de/*', array('controller' => 'tests', 'action' => 'view'));
    Router::connect('/pho-thong-co-so/tron-de/*', array('controller' => 'tests', 'action' => 'mixed'));
    Router::connect('/pho-thong-co-so/tao-de', array('controller' => 'tests', 'action' => 'add'));
    Router::connect('/pho-thong-co-so/tao-de/buoc-1', array('controller' => 'tests', 'action' => 'add', 'step1'));
    Router::connect('/pho-thong-co-so/tao-de/buoc-2', array('controller' => 'tests', 'action' => 'add', 'step2'));
    Router::connect('/pho-thong-co-so/tao-de/buoc-2/*', array('controller' => 'tests', 'action' => 'add', 'step2'));
    Router::connect('/nguoi-dung/de-ca-nhan/*', array('controller' => 'tests', 'action' => 'viewall'));
    
    Router::connect('/nguoi-dung/de-ca-nhan/1/*', array('controller' => 'tests', 'action' => 'viewall', 1));
    Router::connect('/nguoi-dung/de-ca-nhan/2/*', array('controller' => 'tests', 'action' => 'viewall', 2));
    Router::connect('/nguoi-dung/de-ca-nhan/3/*', array('controller' => 'tests', 'action' => 'viewall', 3));
    Router::connect('/nguoi-dung/de-ca-nhan/4/*', array('controller' => 'tests', 'action' => 'viewall', 4));
    Router::connect('/nguoi-dung/de-ca-nhan/5/*', array('controller' => 'tests', 'action' => 'viewall', 5));
    Router::connect('/nguoi-dung/de-ca-nhan/6/*', array('controller' => 'tests', 'action' => 'viewall', 6));
    Router::connect('/nguoi-dung/de-ca-nhan/7/*', array('controller' => 'tests', 'action' => 'viewall', 7));
    Router::connect('/nguoi-dung/de-ca-nhan/8/*', array('controller' => 'tests', 'action' => 'viewall', 8));
    Router::connect('/nguoi-dung/de-ca-nhan/9/*', array('controller' => 'tests', 'action' => 'viewall', 9));
    Router::connect('/nguoi-dung/de-ca-nhan/10/*', array('controller' => 'tests', 'action' => 'viewall', 10));
    Router::connect('/nguoi-dung/de-ca-nhan/11/*', array('controller' => 'tests', 'action' => 'viewall', 11));
    
    Router::connect('/pho-thong-co-so/chia-se-de/*', array('controller' => 'tests', 'action' => 'share'));
    Router::connect('/pho-thong-co-so/huy-chia-se-de/*', array('controller' => 'tests', 'action' => 'notshare'));
    Router::connect('/pho-thong-co-so/xoa-de/*', array('controller' => 'tests', 'action' => 'delete'));
    Router::connect('/pho-thong-co-so/che-do-chinh-sua/*', array('controller' => 'tests', 'action' => 'edit'));
    Router::connect('/pho-thong-co-so/chinh-sua-ma-de/*', array('controller' => 'tests', 'action' => 'edithead'));
    Router::connect('/pho-thong-co-so/thich-de/*', array('controller' => 'tests', 'action' => 'like'));
    Router::connect('/pho-thong-co-so/khong-thich-de/*', array('controller' => 'tests', 'action' => 'notlike'));
    
    /** user **/
    Router::connect('/dang-nhap', array('controller' => 'users', 'action' => 'login'));
    Router::connect('/dang-ky', array('controller' => 'users', 'action' => 'register'));
    Router::connect('/dang-ky/buoc-1', array('controller' => 'users', 'action' => 'register', 'step1'));
    Router::connect('/dang-ky/buoc-2', array('controller' => 'users', 'action' => 'register', 'step2'));
    Router::connect('/dang-ky/buoc-3', array('controller' => 'users', 'action' => 'register', 'step3'));
    Router::connect('/dang-ky/thong-bao', array('controller' => 'users', 'action' => 'register', 'abort'));
    Router::connect('/dang-xuat/*', array('controller' => 'users', 'action' => 'logout'));
    
    Router::connect('/nguoi-dung/thong-tin/*', array('controller' => 'users', 'action' => 'view'));
    Router::connect('/nguoi-dung/sua-thong-tin/*', array('controller' => 'users', 'action' => 'edit'));
    Router::connect('/nguoi-dung/doi-mat-khau/*', array('controller' => 'users', 'action' => 'changepass'));
    
    /** question **/
    Router::connect('/pho-thong-co-so/them-cau-hoi/*', array('controller' => 'questions', 'action' => 'add'));
    Router::connect('/pho-thong-co-so/chinh-sua-cau-hoi/*', array('controller' => 'questions', 'action' => 'edit'));
    Router::connect('/pho-thong-co-so/xoa-cau-hoi/*', array('controller' => 'questions', 'action' => 'delete'));  
    Router::connect('/pho-thong-co-so/reset/*', array('controller' => 'questions', 'action' => 'fmclear'));
    
    /** index **/
    Router::connect('/trang-chu', array('controller' => 'index', 'action' => 'index'));
    Router::connect('/tim-kiem', array('controller' => 'index', 'action' => 'search'));
    
    /** comment **/
    Router::connect('/lien-he-gop-y', array('controller' => 'comments', 'action' => 'add'));
    
    /** disscussion **/
    Router::connect('/chinh-sua-thao-luan/*', array('controller' => 'discussions', 'action' => 'edit'));
    /** training **/
    Router::connect('/de-on-luyen', array('controller' => 'trainings', 'action' => 'index'));
    Router::connect('/de-on-luyen/tuyen-sinh-10', array('controller' => 'trainings', 'action' => 'view10'));
    Router::connect('/de-on-luyen/tuyen-sinh-10/toan-hoc/*', array('controller' => 'trainings', 'action' => 'view10', 1));
    Router::connect('/de-on-luyen/tuyen-sinh-10/ngu-van/*', array('controller' => 'trainings', 'action' => 'view10', 2));
    Router::connect('/de-on-luyen/tuyen-sinh-10/tieng-anh/*', array('controller' => 'trainings', 'action' => 'view10', 3));
    
    Router::connect('/de-on-luyen/thi-tot-nghiep', array('controller' => 'trainings', 'action' => 'viewtn'));
    Router::connect('/de-on-luyen/thi-tot-nghiep/toan-hoc/*', array('controller' => 'trainings', 'action' => 'viewtn', 4));
    Router::connect('/de-on-luyen/thi-tot-nghiep/vat-ly/*', array('controller' => 'trainings', 'action' => 'viewtn', 5));
    Router::connect('/de-on-luyen/thi-tot-nghiep/hoa-hoc/*', array('controller' => 'trainings', 'action' => 'viewtn', 6));
    Router::connect('/de-on-luyen/thi-tot-nghiep/sinh-hoc/*', array('controller' => 'trainings', 'action' => 'viewtn', 7));
    Router::connect('/de-on-luyen/thi-tot-nghiep/ngu-van/*', array('controller' => 'trainings', 'action' => 'viewtn', 8));
    Router::connect('/de-on-luyen/thi-tot-nghiep/tieng-anh/*', array('controller' => 'trainings', 'action' => 'viewtn', 9));
    
    Router::connect('/de-on-luyen/thi-dai-hoc', array('controller' => 'trainings', 'action' => 'viewdh'));
    Router::connect('/de-on-luyen/thi-dai-hoc/toan-hoc/*', array('controller' => 'trainings', 'action' => 'viewdh', 10));
    Router::connect('/de-on-luyen/thi-dai-hoc/vat-ly/*', array('controller' => 'trainings', 'action' => 'viewdh', 11));
    Router::connect('/de-on-luyen/thi-dai-hoc/hoa-hoc/*', array('controller' => 'trainings', 'action' => 'viewdh', 12));
    Router::connect('/de-on-luyen/thi-dai-hoc/sinh-hoc/*', array('controller' => 'trainings', 'action' => 'viewdh', 13));
    Router::connect('/de-on-luyen/thi-dai-hoc/ngu-van/*', array('controller' => 'trainings', 'action' => 'viewdh', 14));
    Router::connect('/de-on-luyen/thi-dai-hoc/tieng-anh/*', array('controller' => 'trainings', 'action' => 'viewdh', 15));
    
    Router::connect('/de-on-luyen/xem-de/*', array('controller' => 'trainings', 'action' => 'viewtest'));
/**
 * Load all plugin routes.  See the CakePlugin documentation on 
 * how to customize the loading of plugin routes.
 */
	CakePlugin::routes();

/**
 * Load the CakePHP default routes. Remove this if you do not want to use
 * the built-in default routes.
 */
	require CAKE . 'Config' . DS . 'routes.php';
